Particle Cloud

Using the same setup as detailed_look.jl or example2(), here we simulate a point cloud getting advected by the flow field. For additional documentation e.g. see : 1, 2, 3, 4

1. Import Software

using IndividualDisplacements, OrdinaryDiffEq, Statistics
p=dirname(pathof(IndividualDisplacements))
include(joinpath(p,"../examples/recipes_plots.jl"))
include(joinpath(p,"../examples/example123.jl"));

2. Setup Problem

๐‘ƒ,ฮ“=example2_setup()

ii1=5:5:40; ii2=5:5:25
x=vec([x-0.5 for x in ii1, y in ii2])
y=vec([y-0.5 for x in ii1, y in ii2])
xy=transpose([x y])

๐‘ƒ.๐‘‡[:] = [0.0,2998*3600.0]
solv(prob) = solve(prob,Tsit5(),reltol=1e-6,abstol=1e-6)
tr = DataFrame([fill(Int, 1) ; fill(Float64, 3)], [:ID, :x, :y, :t])

๐ผ = Individuals{Float64}(๐Ÿ“Œ=xy[:,:], ๐Ÿ”ด=tr, ๐Ÿ†”=collect(1:size(xy,2)),
                         ๐Ÿš„ = dxy_dt, โˆซ = solv, ๐Ÿ”ง = postprocess_xy, ๐‘ƒ=๐‘ƒ);

3. Compute Trajectories

๐‘‡=(0.0,๐ผ.๐‘ƒ.๐‘‡[2])
โˆซ!(๐ผ,๐‘‡)
2ร—40 Array{Float64,2}:
   5.91182   10.5953   11.087   12.6622  โ€ฆ  37.9639   29.12    30.6396
 -12.3525   124.028   487.117  478.34        8.68514  19.2392  22.4415

4. Display results

๐ผ.๐Ÿ”ด.lon=5000*๐ผ.๐Ÿ”ด.x
๐ผ.๐Ÿ”ด.lat=5000*๐ผ.๐Ÿ”ด.y
plt=PlotBasic(๐ผ.๐Ÿ”ด,size(xy,2),100000.0)

Compare with trajectory output from MITgcm

#df=read_flt(IndividualDisplacements.flt_example,Float32)
#ref=PlotBasic(df,size(xy,2),100000.0)

This page was generated using Literate.jl.